Best practices for prompt engineering with OpenAI API
How to give clear and effective instructions to GPT-3 and Codex
Rules of Thumb and Examples
1. Use the latest model
2. Put instructions at the beginning of the prompt and use ### or """ to separate the instruction and context
デリミタの使用
3. Be specific, descriptive and as detailed as possible about the desired context, outcome, length, format, style, etc
「Write a poem」ではなく、具体的にfocusingなどを伝える例
4. Articulate the desired output format through examples
Show, and tell
Extract the important entities mentioned in the text below. First extract all company names, then extract all people names, then extract specific topics which fit the content and finally extract general overarching themes
Desired formatも指定している
5. Start with zero-shot, then few-shot, neither of them worked, then fine-tune
「zero-shotで始め、次にfew-shot、いずれも機能しなければfine-tune」
Extract keywords from the corresponding texts below.
few-shotの例がある
6. Reduce “fluffy” and imprecise descriptions
Use a 3 to 5 sentence paragraph
7. Instead of just saying what not to do, say what to do instead
「すべきでないことの代わりに、すべきこと」
IMO:否定に弱い?
8. Code Generation Specific - Use “leading words” to nudge the model toward a particular pattern
Additional Resources(積ん読)